from django.conf.urls import url
from . import views,CartViews  # 连接视图函数


urlpatterns = [
    # 首页
    url(r'^$',views.index,name="myhome_index"),
    # 列表页
    url(r'^list/(?P<tid>[0-9]+)/$',views.goodslist,name="myhome_list"),
    # 详情页
    url(r'^info/(?P<gid>[0-9]+)/$',views.goodsinfo,name="myhome_info"),





    # 登录
    url(r'^login/$',views.login,name="myhome_login"),
    # 退出登录
    url(r'^logout/$',views.logout,name="myhome_logout"),
    # 注册
    url(r'^register/$',views.register,name="myhome_register"),
    # 验证码
    url(r'^verifycode/$',views.verifycode,name="myhome_verifycode"),

    url(r'^xiugai/$',views.xxx),



    # 购物车
    # 添加
    url(r'^cart/add/$',CartViews.cartadd,name="myhome_cartadd"),
    # 列表
    url(r'^cart/index/$',CartViews.cartindex,name="myhome_cartindex"),
    # 清空
    url(r'^cart/claer/$',CartViews.cartclear,name="myhome_cartclear"),
    # 删除
    url(r'^cart/delete(?P<gid>[0-9]+)/$',CartViews.cartdelete,name="myhome_cartdelete"),
    # 修改
    url(r'^cart/edit/$',CartViews.cartedit,name="myhome_cartedit"),




    # 确认订单
    url(r'^order/confirm/$', CartViews.orderconfirm,name="myhome_orderconfirm"),

    # 添加收货地址
    url(r'^address/insert/$', CartViews.addressinsert,name="myhome_addressinsert"),
   
    # 生成订单(不给用户看过程)
    url(r'^order/create/$', CartViews.ordercreate,name="myhome_ordercreate"),
    # 支付页面
    url(r'^order/buy/(?P<oid>[0-9]+)/$',  CartViews.orderbuy,name="myhome_orderbuy"),
    # 支付
    url(r'^order/buy/success/(?P<oid>[0-9]+)/$', CartViews.orderbuysuccess,name="myhome_orderbuysuccess"),
    # 取消付款
    url(r'^order/nobuy/success/(?P<oid>[0-9]+)/$', CartViews.ordernobuysuccess,name="myhome_ordernobuysuccess"),

    # 个人中心,我的订单
    url(r'^myorder/$', CartViews.myorder,name="myhome_myorder"),


    # 我的地址
    url(r'^mysite/$', CartViews.mysite,name="myhome_mysite"),
     # 删除收货地址
    url(r'^delsite/(?P<oid>[0-9]+)/$', CartViews.delsite,name="myhome_delsite"),
    # 修改地址
    url(r'^editsite/$', CartViews.editsite,name="myhome_editsite"),

    # 个人中心
    url(r'^mycenter/$', CartViews.mycenter,name="myhome_mycenter"),
    # 修改信息
    url(r'^editcenter/(?P<uid>[0-9]+)/$', CartViews.editcenter,name="myhome_editcenter"),
    # 执行修改
    url(r'^updatecenter',CartViews.updatecenter,name="myhome_updatecenter"),

     # 短信验证
    url(r'^sendmsg/$', views.sendmsg,name="sendmsg"),

]